package com.yy.model;

//import java.util.HashSet;
//import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
//import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
//import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.criteria.CriteriaBuilder.In;

import org.hibernate.annotations.Proxy;

import com.yy.dto.JobDTO;

@Entity
@Table(name = "tb_job", catalog = "jspbighomework")
@Proxy(lazy = false)
public class TbJob implements java.io.Serializable{
	
	private Integer jobId;
	private String 	jobName;
	private Integer jobCompany;
	private Integer jobNum;
	private Integer jobHave;
	
	public TbJob(){
		
	}
	
	public TbJob(Integer jobId,String jobName,Integer jobCompany,Integer jobNum,Integer jobHave)
	{
		this.jobId=jobId;
		this.jobName=jobName;
		this.jobCompany=jobCompany;
		this.jobNum=jobNum;
		this.jobHave=jobHave;	
	}
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "job_id", unique = true, nullable = false)
	public Integer getJobId() {
		return jobId;
	}

	public void setJobId(Integer jobId) {
		this.jobId = jobId;
	}
	
	@Column(name = "job_name", nullable = false)
	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}
	
	@Column(name = "job_company", nullable = false)
	public Integer getJobCompany() {
		return jobCompany;
	}

	public void setJobCompany(Integer jobCompany) {
		this.jobCompany = jobCompany;
	}
	
	@Column(name = "job_num", nullable = false)
	public Integer getJobNum() {
		return jobNum;
	}

	public void setJobNum(Integer jobNum) {
		this.jobNum = jobNum;
	}
	
	@Column(name = "job_have", nullable = false)
	public Integer getJobHave() {
		return jobHave;
	}

	public void setJobHave(Integer jobHave) {
		this.jobHave = jobHave;
	}
	
	public JobDTO toDTO(){
		JobDTO jobDTO=new JobDTO();
		jobDTO.setJobId(this.getJobId());
		jobDTO.setJobName(this.getJobName());
		jobDTO.setJobCompany(this.getJobCompany());
		jobDTO.setJobNum(this.getJobNum());
		jobDTO.setJobHave(this.getJobHave());
		
		return jobDTO;
		
	}
	

}
